home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / TIFF_40.ZIP / tiff_40.txt
Internet Message Format  |  1994-07-04  |  34KB

  1. From ffeschet@ens-lyon.fr Sun Jul  3 12:22:32 1994
  2. From: ffeschet@ens-lyon.fr (Fabien Feschet)
  3. Newsgroups: alt.graphics.pixutils
  4. Subject: TIFF specification...
  5. Date: 29 Jun 1994 08:43:50 GMT
  6. Organization: Ecole Normale Superieure de Lyon
  7. Distribution: world
  8. Reply-To: ffeschet@ens-lyon.fr
  9. NNTP-Posting-Host: ens.ens-lyon.fr
  10.  
  11. Hi,
  12.    These is the Tiff specification. Enjoy... email if you want precision...
  13.  
  14. <<Begin TIFF-1>>
  15.  
  16.  
  17. Tag Image File Format  Rev 4.0
  18. April 31, 1987
  19.  
  20. This memorandum has been prepared jointly by Aldus and Microsoft in conjunction
  21. with leading scanner and printer manufacturers.  This document does not
  22. represent a commitment on the part of either Microsoft or Aldus to provide
  23. support for this file format in any application.  When responding to specific
  24. issues raised in this memo, or when requesting additional tag or field
  25. assignments, please address your correspondence to either:
  26.  
  27.           Tim Davenport                       Manny Vellon
  28.           Aldus Corporation                   Windows Marketing Group
  29.           411 First Ave. South                Microsoft Corporation
  30.           Suite 200                           16011 NE 36th Way
  31.           Seattle, WA  98104                  Box 97017
  32.                                               Redmond, WA  98073-9717
  33.  
  34.  
  35. Revision Notes
  36.  
  37. This release of the TIFF specification has been given a Revision number.  It is
  38. really the fourth major revision, so the Revision number was set to 4.0.
  39.  
  40.  
  41. Abstract
  42.  
  43. This document describes TIFF, a tag based file format that is designed to
  44. promote the interchange of digital image data.
  45.  
  46. The fields were defined primarily with desktop publishing and related
  47. applications in mind, although it is conceivable that other sorts of imaging
  48. applications may find TIFF to be useful.
  49.  
  50. The general scenario for which TIFF was invented assumes that applications
  51. software for scanning or painting creates a TIFF file, which can then be read
  52. and incorporated into a document or publication by an application such as a
  53. desktop publishing package.
  54.  
  55. The intent of TIFF is to organize and codify existing practice with respect to
  56. the definition and usage of desktop digital data, not to blaze new paths or
  57. promote unproven techniques.  Yet a very high priority has been given to
  58. structuring the data in such a way as to minimize the pain of future additions.
  59.  TIFF was designed to be a very extensible interchange format.
  60.  
  61. TIFF is not a printer language or page description language, nor is it intended
  62. to be a general document interchange standard.  It may be useful as is for some
  63. image editing applications, but is probably inappropriate for  and would thus
  64. need to be translated into some intermediate data structures by  other image
  65. editing applications.  The primary design goal was to provide a rich
  66. environment within which the exchange of image data between application
  67. programs can be accomplished.  This richness is required in order to take
  68. advantage of the varying capabilities of scanners and similar devices.  TIFF is
  69. therefore designed to be a superset of existing image file formats for desktop
  70. scanners (and paint programs and anything else that produces images with pixels
  71. in them) and will be enhanced on a continuing basis as new capabilities arise.
  72.  
  73. Although TIFF is claimed to be in some sense a rich format, it can easily be
  74. used for simple scanners and applications as well, since the application
  75. developer need only be concerned with the capabilities that he requires.  The
  76. mechanisms for accomplishing this goal are discussed in the next section.
  77.  
  78. TIFF is intended to be independent of specific operating systems, filing
  79. systems, compilers, and processors.  The only significant assumption is that
  80. the storage medium supports something like a file, defined as a sequence of
  81. 8-bit bytes, where the bytes are numbered from 0 to N.  The largest possible
  82. TIFF file is 2**32 bytes.  Since pointers (byte offsets) are used liberally, a
  83. TIFF file is most easily read from a random access device, although it is
  84. possible to read and write TIFF files on sequential media such as magnetic
  85. tape.
  86.  
  87. The recommended MS-DOS file extension for TIFF files is .TIF.  The recommended
  88. Macintosh filetype is TIFF.  Conventions in other computing environments have
  89. not yet been established.
  90.  
  91.  
  92. 1) Conformance
  93.  
  94. Many of the application programs that read the contents of TIFF image files
  95. will not support all of the features described in this document.  In some
  96. cases, little more than the default options will be supported.  It is up to
  97. each organization to determine the costs and benefits associated with different
  98. levels of conformity.  Therefore, claims of conformity to this specification
  99. should be interpreted with a certain amount of caution.
  100.  
  101. It follows that the usage of this specification does not preclude the need for
  102. coordination between image file writers and image file readers.  It is up to
  103. the application designer that initially writes a file in this format to verify
  104. that the desired file options are supported by the applications that will read
  105. the file.
  106.  
  107.  
  108. 2) Structure
  109.  
  110. In TIFF, individual fields are identified with a unique tag. This allows
  111. particular fields to be present or absent from the file as required by the
  112. application.
  113.  
  114. Some TIFF files will have only a few fields in them; others will have many.
  115. Software that creates TIFF files should write out as many fields as it believes
  116. will be meaningful and useful (and no more).  Software that reads TIFF files
  117. should do the best it can with the fields that it finds there.
  118.  
  119. See Appendix A:  Tag Structure Rationale.
  120.  
  121. There are many ways in which a tag-oriented file format scheme can be
  122. implemented.  TIFF uses the following approach:
  123.  
  124. There are three main parts to a TIFF file.  First is a short image file header.
  125. Next is a directory of all the fields that are to be found in this file.
  126. Finally, we have the data for the fields.
  127.  
  128.  
  129. 3) Header and Directory
  130.  
  131. A TIFF file begins with a small amount of positionally defined data, containing
  132. the following information:
  133.  
  134. Bytes 0-1:
  135.  
  136. The first word of the file serves to specify the byte order used within the
  137. file.  The currently defined values are:
  138.  
  139.      II        (hex 4949)
  140.      MM        (hex 4D4D)
  141.  
  142. In the II format, byte order is always from least significant to most
  143. significant, for both 16-bit and 32-bit integers.
  144.  
  145. In the MM format, byte order is always from most significant to least
  146. significant, for both 16-bit and 32-bit integers.
  147.  
  148. In both formats, character strings are stored into sequential byte locations.
  149.  
  150. It is certainly not required that all applications software be able to handle
  151. both formats.  It should be apparent which is the native format for a
  152. particular machine.
  153.  
  154. Bytes 2-3:
  155.  
  156. The second word of the file is the TIFF version number.  This number shouldnt
  157. change.  This document describes Version 42, so 42 (2A in hex) should be stored
  158. in this word.
  159.  
  160. Bytes 4-7:
  161.  
  162. This long word contains the offset (in bytes) of the first Image File
  163. Directory.  The directory may be at any location in the file after the header
  164. but must begin on a word boundary.
  165.  
  166. (The term byte offset is always used in this document to refer to a location
  167. with respect to the beginning of the file.  The first byte of the file has an
  168. offset of 0.)
  169.  
  170. An IFD consists of a 2-byte count of the number of entries (i.e., the number of
  171. fields), followed by a sequence of 12-byte field entries, followed by a 4-byte
  172. offset of the next Image File Directory (or 0 if none).  Each 12-byte field
  173. entry has the following format:
  174.  
  175. Bytes 0-1 contain the Tag for the field.  Bytes 2-3 contain the field Type.
  176. Bytes 4-7 contain the Length (Count might have been a better term) of the
  177. field.  Bytes 8-11 contain the file offset (in bytes) of the Value for the
  178. field.  The Value is expected to begin on a word boundary; the corresponding
  179. file offset will thus be an even number.
  180.  
  181. The entries in an IFD must be sorted in ascending order by Tag.  Note that this
  182. is not the order in which the fields are described in this document.  The
  183. Values to which directory entries point need not be in any particular order in
  184. the file.
  185.  
  186. If the Value fits within 4 bytes, the Offset is interpreted to contain the
  187. Value instead of pointing to the Value, to save a little time and space.  If
  188. the Value is less than 4 bytes, it is left-justified.  Whether or not it fits
  189. within 4 bytes can be determined by looking at the Type and Length of the
  190. field.
  191.  
  192. The Length part is specified in terms of the data type.  A single 16-bit word
  193. (SHORT) has a Length of 1, not 2, for example.  The data types and their
  194. lengths are described below:
  195.  
  196.      1 = BYTE.      8-bit unsigned integer.
  197.      2 = ASCII.     8-bit bytes that store ASCII codes; the last byte must
  198.                      be null.
  199.      3 = SHORT.     A 16-bit (2-byte) unsigned integer.
  200.      4 = LONG.      A 32-bit (4-byte) unsigned integer.
  201.      5 = RATIONAL.  Two LONGs:  the first represents the numerator of a
  202.                      fraction,  the second the denominator.
  203.  
  204. The value of the Length part of an ASCII field entry includes the null.  If
  205. padding is necessary, the Length does not include the pad byte.
  206.  
  207. The reader should check the type to ensure that it is what he expects.  TIFF
  208. currently allows more than 1 valid type for a given field.  For example,
  209. ImageWidth and ImageLength were specified as having type SHORT.  Very large
  210. images with more than 64k rows or columns are possible with some devices even
  211. now.  Rather than add parallel LONG tags for these fields, it is cleaner to
  212. allow both SHORT and LONG for ImageWidth and similar fields.  Writers of TIFF
  213. files are, however, encouraged to use the default type values as indicated in
  214. this document to insure compatbility with existing TIFF reader applications.
  215.  
  216. Note that there may be more than one IFD.  Each IFD is said to define a
  217. subfile.  One potential use of subsequent subfiles is to describe a sub-image
  218. that is somehow related to the main image, such as a reduced resolution or
  219. screen resolution image.  Another use is to represent multiple page images -
  220. for example, a facsimile document requiring more than one page.  Subsequent
  221. IFDs will in general contain many of the same fields as the first IFD but will
  222. usually point to or contain different Values for those fields.
  223.  
  224.  
  225. 4) Definitions
  226.  
  227. The TIFF structure itself is not specific to imaging applications in any way.
  228. It is only the definitions of the fields themselves that jointly describe an
  229. image.  Before we begin describing the fields, a few image related definitions
  230. may be useful.
  231.  
  232. An image is defined to be a rectangular array of pixels, each of which consists
  233. of one or more samples.  With monochromatic data, we have one sample per pixel,
  234. and sample and pixel can be used interchangeably.  Color data usually contains
  235. three samples per pixel, as in, for example, an RGB scheme.
  236.  
  237.  
  238. 5) The Fields
  239.  
  240. The following fields are defined in this version of TIFF.  More will be added
  241. in future versions, if possible in such a way so as not to break old software
  242. that encounters a newer TIFF file.  An attempt has been made to group related
  243. fields, although the grouping is necessarily somewhat arbitrary.
  244.  
  245. The documentation for each field contains the name of the field (quite
  246. arbitrary, but convenient), the Tag value, the field Type, the Number of Values
  247. (N) expected (per IFD, in the case of multiple subfiles), comments describing
  248. the field, and the default, if any.  The default value is used if the field
  249. does not exist.
  250.  
  251. A fairly large number of fields has already been defined, and the number will
  252. grow.  Please keep in mind that many common images can be described using only
  253. a handful of these fields (see the Examples section).
  254.  
  255.  
  256. General Description
  257.  
  258. SubfileType
  259. Tag  = 255  (FF)
  260. Type = SHORT
  261. N    = 1
  262.  
  263. A general indication of the kind of data that is contained in this subfile.
  264. Currently defined values are:
  265. 1 = full resolution image data  ImageWidth, ImageLength, and StripOffsets are
  266. required fields.
  267. 2 = reduced resolution image data  ImageWidth, ImageLength, and StripOffsets
  268. are required fields.  It is further assumed that a reduced resolution image is
  269. a reduced version of the entire extent of the corresponding full resolution
  270. data.
  271. 3 = Single page of a multi-page image (see the PageNumber tag description).
  272.  
  273. If your kind of image data doesnt fit nicely into either description, contact
  274. either Aldus or Microsoft to define an additional value.  Note that both image
  275. types can be found in a single TIFF file, with each subfile described by its
  276. own IFD.
  277. No default.
  278.  
  279.  
  280. Data Architecture
  281.  
  282. ImageWidth
  283. Tag  = 256  (100)
  284. Type = SHORT
  285. N    = 1
  286.  
  287. The images width, in pixels (X: horizontal).  The number of columns in the
  288. image.
  289. No default.
  290.  
  291.  
  292. ImageLength
  293. Tag  = 257  (101)
  294. Type = SHORT
  295. N    = 1
  296.  
  297. The images length (height) in pixels (Y: vertical).  The number of rows
  298. (sometimes described as scan lines) in the image.  ImageLength and ImageWidth
  299. refer only to how the pixels are stored in the file and do not imply anything
  300. about where the visual top or left side of the image may be.  See Orientation
  301. for this information.
  302. No default.
  303.  
  304.  
  305. RowsPerStrip
  306. Tag  = 278  (116)
  307. Type = SHORT or LONG
  308. N    = 1
  309.  
  310. The number of rows per strip.  The image data is organized into strips for fast
  311. access to individual rows when the data is compressed (though this field is
  312. valid even if the data is not compressed).
  313.  
  314. Note that either SHORT or LONG values can be used to specify RowsPerStrip.
  315. SHORT values  may be used for small TIFF files.   It should be noted, however,
  316. that earlier TIFF specifications required LONG values and that some  software
  317. may not expect SHORT values.
  318.  
  319. Default is 2**32 - 1, which is effectively infinity.  That is, the entire image
  320. is one strip.
  321.  
  322.  
  323. [StripsPerImage]
  324. N    = 1
  325.  
  326. The number of strips per image.  This value is not a field, since it can be
  327. computed from two other fields, but it is convenient to give it a name in order
  328. to clarify the use of other fields.  The equation to use is StripsPerImage =
  329. (ImageLength + RowsPerStrip - 1) / RowsPerStrip, assuming integer arithmetic.
  330.  
  331.  
  332. StripOffsets
  333. Tag  = 273  (111)
  334. Type = SHORT or LONG
  335. N    = StripsPerImage for PlanarConfiguration equal to 1.
  336.      = SamplesPerPixel * StripsPerImage for PlanarConfiguration equal to 2
  337.  
  338. For each strip, the byte offset of that strip.  The offset is specified with
  339. respect to the beginning of the TIFF file.  Note that this implies that each
  340. strip has a location independent of the locations of other strips.  This
  341. feature may be useful for certain editing applications.  This field is the only
  342. way for a reader to find the image data, and hence must exist.
  343.  
  344. Note that either SHORT or LONG values can be used to specify the strip offsets.
  345. SHORT values  may be used for small TIFF files.   It should be noted, however,
  346. that earlier TIFF specifications required LONG strip offsets and that some
  347. software may not expect SHORT values.
  348. No default.
  349.  
  350.  
  351. StripByteCounts
  352. Tag  = 279  (117)
  353. Type = LONG
  354. N    = StripsPerImage for PlanarConfiguration equal to 1.
  355.      = SamplesPerPixel * StripsPerImage for PlanarConfiguration equal to 2
  356.  
  357. For each strip, the number of bytes in that strip.
  358. No default.
  359.  
  360.  
  361. SamplesPerPixel
  362. Tag  = 277  (115)
  363. Type = SHORT
  364. N    = 1
  365.  
  366. The number of samples per pixel.  Usually 1 for monochromatic data and 3 for
  367. color data (i.e. one sample for each of the color planes.)
  368. Default = 1.
  369.  
  370.  
  371. BitsPerSample
  372. Tag  = 258  (102)
  373. Type = SHORT
  374. N    = SamplesPerPixel
  375.  
  376. Number of bits per sample.  Note that  this tag allows a different number of
  377. bits per sample for each sample corresponding to a pixel.  For example, RGB
  378. color data could use a different number of bits per sample for each of the
  379. three color planes.
  380. Default = 1.
  381.  
  382.  
  383. PlanarConfiguration
  384. Tag  = 284  (11C)
  385. Type = SHORT
  386. N    = 1
  387.  
  388. 1 = the sample values for each pixel are stored contiguously, so that there is
  389. a single image plane.  See PhotometricInterpretation to determine the order of
  390. the samples within the pixel data.
  391. 2 = the samples are stored in separate sample planes.  The values in
  392. StripOffsets and StripByteCounts are then arranged as a 2-dimensional array,
  393. with SamplesPerPixel rows and StripsPerImage columns.  (All of the columns for
  394. row 0 are stored first, followed by the columns of row 1, and so on.)
  395. PhotometricInterpretation describes the type of data that is stored in each
  396. sample plane.
  397.  
  398. If SamplesPerPixel is 1, a PlanarConfiguration value of 1 is equivalent to a
  399. value of 2.
  400. No default.
  401.  
  402.  
  403. Compression
  404. Tag  = 259  (103)
  405. Type = SHORT
  406. N    = SamplesPerPixel for PlanarConfiguration equal to 1 or 2.
  407.  
  408. Note that a value is provided for each sample, allowing different compression
  409. schemes to be applied to different planes of data.
  410.  
  411. 1 = No compression, but pack data into bytes as tightly as possible, with no
  412. unused bits except at the end of a row.  See also FillOrder.  The bytes are
  413. stored as an array of type BYTE, for BitsPerSample <= 8, SHORT if BitsPerSample
  414. > 8 and <= 16, and LONG if BitsPerSample > 16 and <= 32.  The byte ordering of
  415. data >8 bits must be consistent with that specified in the TIFF file header
  416. (bytes 0 and 1).  Intel format files will have the least significant bytes
  417. preceeding the most significant bytes while Motorola format files will have the
  418. opposite.
  419.  
  420. If the number of bits per sample is not a power of 2, and you are willing to
  421. give up some space for better performance, you may wish to use the next higher
  422. power of 2.  For example, if your data can be represented in 6 bits, you may
  423. wish to specify that it is 8 bits deep.  If you take this approach, you should
  424. be sure that MinSampleValue and MaxSampleValue are given correct values
  425. (probably 0 and 63 for intrinsically 6-bit data.)  TIFF file readers should use
  426. MinSampleValue and MaxSampleValue to determine the range of values in the data
  427. rather than BitsPerSample.
  428.  
  429. Rows are required to begin on byte boundaries.
  430.  
  431. 2 = CCITT Group 3 1-Dimensional Modified Huffman run length encoding.  See
  432. Appendix B:  Data Compression  Scheme 2. BitsPerSample must be 1, since this
  433. type of compression is defined only for binary images.
  434.  
  435. 3 = Facsimile-compatible CCITT Group 3, exactly as specified in Standardization
  436. of Group 3 facsimile apparatus for document transmission, Recommendation T.4,
  437. Volume VII, Fascicle VII.3, Terminal Equipment and Protocols for Telematic
  438. Services, The International Telegraph and Telephone Consultative Committee
  439. (CCITT), Geneva, 1985, pages 16 through 31.  Each strip must begin on a byte
  440. boundary.  (But recall that an image can be a single strip.)  Rows that are not
  441. the first row of a strip are not required to begin on a byte boundary.  The
  442. data is stored as bytes, not words  byte-reversal is not allowed.  Note that
  443. the FillOrder field still applies.  See the Group3Options field for Group 3
  444. options such as 1D vs 2D coding.
  445.  
  446. 4 = Facsimile-compatible CCITT Group 4, exactly as specified in Facsimile
  447. Coding Schemes and Coding Control Functions for Group 4 Facsimile Apparatus,
  448. Recommendation T.6, Volume VII, Fascicle VII.3, Terminal Equipment and
  449. Protocols for Telematic Services, The International Telegraph and Telephone
  450. Consultative Committee (CCITT), Geneva, 1985, pages 40 through 48.  Each strip
  451. must begin on a byte boundary.  Rows that are not the first row of a strip are
  452. not required to begin on a byte boundary.  The data is stored as bytes, not
  453. words.  Note that the FillOrder field still applies.  See the Group4Options
  454. field for Group 4 options.
  455.  
  456. 32771 = the same thing as Compression type 1 (no compression), except that each
  457. row begins on the next available word boundary, instead of byte boundary.
  458.  
  459. 32773 = PackBits compression, a relatively simple byte-oriented run-length
  460. scheme.  See Appendix C.
  461.  
  462. Data compression only applies to pixel data, as pointed to by StripOffsets.
  463. All other TIFF information is unaffected.
  464.  
  465. To be determined are additional compression schemes for gray and colored
  466. images.  We encourage your suggestions, especially if accompanied by full
  467. specifications and performance information.  It is of course desirable to
  468. minimize the number of compression schemes that are being used, but this is
  469. clearly an area in which extremely significant time and space tradeoffs exist.
  470. Default = 1.
  471.  
  472.  
  473. Group3Options
  474. Tag  = 292  (124)
  475. Type = LONG
  476. N    = 1
  477.  
  478. This field is made up of a set of 32 flag bits.  Unused bits are expected to be
  479. 0.  Bit 0 is the low-order bit.  It is probably not safe to try to read the
  480. file if any bit of this field is set that you dont know the meaning of.
  481.  
  482. Bit 0 is 1 for 2-dimensional coding (else 1-dimensional is assumed).  For 2-D
  483. coding, if more than one strip is specified, each strip must begin with a
  484. 1-dimensionally coded line.  That is, RowsPerStrip should be a multiple of
  485. Parameter K as documented in the CCITT specification.
  486.  
  487. Bit 1 is 1 if uncompressed mode is used.
  488.  
  489. Bit 2 is 1 if fill bits have been added as necessary before EOL codes such that
  490. EOL always ends on a byte boundary, thus ensuring an eol-sequence of a 1 byte
  491. preceded by a zero nibble:  xxxx-0000 0000-0001.
  492.  
  493. Default is 0, for basic 1-dimensional coding.
  494.  
  495.  
  496. Group4Options
  497. Tag  =  293  (125)
  498. Type = LONG
  499. N    = 1
  500.  
  501. This field is made up of a set of 32 flag bits.  Unused bits are expected to be
  502. 0.  Bit 0 is the low-order bit.  It is probably not safe to try to read the
  503. file if any bit of this field is set that you dont know the meaning of.  Gray
  504. scale and color coding schemes are under study, and will be added when
  505. finalized.
  506.  
  507. For 2-D coding, each strip is encoded as if it were a separate image.  In
  508. particular, each strip begins on a byte boundary; and the coding for the first
  509. row of a strip is encoded independently of the previous row, using horizontal
  510. codes, as if the previous row is entirely white.  Each strip ends with the
  511. 24-bit end-of-facsimile block (EOFB).
  512.  
  513. Bit 0 is unused.
  514.  
  515. Bit 1 is 1 if uncompressed mode is used.
  516.  
  517. Default is 0, for basic 2-dimensional binary compression.
  518.  
  519.  
  520. FillOrder
  521. Tag  = 266  (10A)
  522. Type = SHORT
  523. N    = 1
  524.  
  525. The order of data values within a byte.
  526. 1 = most significant bits of the byte are filled first.  That is, data values
  527. (or code words) are ordered from high order bit to low order bit within a byte.
  528.  
  529. 2 = least significant bits are filled first.
  530. Default is FillOrder = 1.
  531.  
  532.  
  533. Threshholding
  534. Tag  = 263  (107)
  535. Type = SHORT
  536. N    = 1
  537.  
  538. 1 = a bilevel line art scan.  BitsPerSample must be 1.
  539. 2 = a halftone or dithered scan, usually of continuous tone data such as
  540. photographs. BitsPerSample must be 1.
  541. 3 = Error Diffused.
  542. Default is Threshholding = 1.
  543.  
  544.  
  545. CellWidth
  546. Tag  = 264  (108)
  547. Type = SHORT
  548. N    = 1
  549.  
  550. The width, in 1-bit samples, of the dithering/halftoning matrix.  Assumes that
  551. Threshholding = 2.  That is, this field is only relevant if Threshholding = 2.
  552.  
  553. No default.
  554.  
  555.  
  556. CellLength
  557. Tag  = 265  (109)
  558. Type = SHORT
  559. N    = 1
  560.  
  561. The length, in 1-bit samples, of the dithering/halftoning matrix.  Assumes that
  562. Threshholding = 2.  This field and the previous field may be useful for
  563. converting from halftoned to true gray level data.
  564. No default.
  565.  
  566.  
  567. Photometrics
  568.  
  569. These fields are useful in determining the visual meaning of the sample data.
  570.  
  571.  
  572. MinSampleValue
  573. Tag  = 280  (118)
  574. Type = SHORT
  575. N    = SamplesPerPixel
  576.  
  577. The minimum valid sample value.
  578. Default is 0.
  579.  
  580.  
  581. MaxSampleValue
  582. Tag  = 281  (119)
  583. Type = SHORT
  584. N    = SamplesPerPixel
  585.  
  586. The maximum valid sample value.
  587. Default is 2**(BitsPerSample) - 1.
  588.  
  589.  
  590. PhotometricInterpretation
  591. Tag  = 262  (106)
  592. Type = SHORT
  593. N    = 1
  594.  
  595. 0 = MinSampleValue should be imaged as white.  MaxSampleValue should be imaged
  596. as black.  If the bit-map represents gray scale, then the values between the
  597. minimum and maximum sample values should be interpreted according to either the
  598. gray scale response curve information (if included) or according to the result
  599. of some more arbitrary rule.  See GrayResponseCurve.
  600.  
  601. 1 = MinSampleValue should be imaged as black. MaxSampleValue should be imaged
  602. as white.  If the bit-map represents gray scale, then the values between the
  603. minimum and maximum sample values should be interpreted according to either the
  604. gray scale response curve information (if included) or according to the result
  605. of some more arbitrary rule.
  606.  
  607. 2 = RGB.  In the RGB model, a color is described as a combination of the three
  608. primary colors of light (red, green, and blue) in particular concentrations.
  609. For each of the three samples, MinSampleValue represents minimum intensity, and
  610. MaxSampleValue represents maximum intensity.  For PlanarConfiguration = 1, the
  611. samples are stored in the indicated order within a pixel:  first Red, then
  612. Green, then Blue.  For PlanarConfiguration = 2, the sample planes are stored in
  613. the indicated order:  first the Red sample plane, then the Green plane, then
  614. the Blue plane.
  615.  
  616. The Red, Green and Blue intensity values are defined according to the NTSC
  617. specifications for primary color chromaticity.  These specifications assume the
  618. illumination to be CIE D6500.  See the Red, Green and Blue color response curve
  619. tags.
  620.  
  621. Note:  some compression schemes, such as the CCITT schemes, imply a particular
  622. PhotometricInterpretation.  Therefore, when reading such data, TIFF readers
  623. should ignore PhotometricInterpretation.  And, ideally, TIFF writers should not
  624. write out the field when using one of these schemes.
  625.  
  626. No default.
  627.  
  628.  
  629. GrayResponseUnit
  630. Tag  = 290 (122)
  631. Type = SHORT
  632. N    = 1
  633.  
  634. 1 = number represents tenths of a unit.
  635. 2 = number represents hundredths of a unit.
  636. 3 = number represents thousandths of a unit.
  637. 4 = number represents ten-thousandths of a unit.
  638. 5 = number represents hundred-thousandths of a unit.
  639. Default is 2.
  640.  
  641.  
  642. GrayResponseCurve
  643. Tag  = 291 (123)
  644. Type = SHORT
  645. N    = 2**BitsPerSample
  646.  
  647. The purpose of the gray response curve and the gray units is to further provide
  648. photometric interpretation information for gray scale image data.  The gray
  649. response curve specifies for given levels of gray between the minimum and
  650. maximum sample values the actual photometric gray level of the value.  It
  651. represents this gray level in terms of optical density.
  652.  
  653. The GrayScaleResponseUnits specifies the accuracy of the information contained
  654. in the curve.  Since optical density is specified in terms of fractional
  655. numbers, this tag is necessary to know how to interpret the stored integer
  656. information.  For example, if GrayScaleResponseUnits is set to 4
  657. (ten-thousandths of a unit), and a GrayScaleResponseCurve number for gray level
  658. 4 is 3455, then the resulting actual value is 0.3455.
  659.  
  660. If the gray scale response curve is known for the data in the TIFF file, and if
  661. the gray scale response of the output device is known, then an intelligent
  662. conversion can be made between the input data and the output device.  For
  663. example, the output can be made to look just like the input.  In addition, if
  664. the input image lacks contrast (as can be seen from the response curve), then
  665. appropriate contrast enhancements can be made.
  666.  
  667. The purpose of the grey scale response curve is to act as a lookup table
  668. mapping values from 0 to 2**BitsPerSample-1 into specific intensity values.
  669. Refer to the PhotometricInterpretation tag to determine how the mapping should
  670. be done.
  671.  
  672.  
  673. ColorResponseUnit
  674. Tag  = 300 (12C)
  675. Type = SHORT
  676. N    = 1
  677.  
  678. 1 = number represents tenths of a unit.
  679. 2 = number represents hundredths of a unit.
  680. 3 = number represents thousandths of a unit.
  681. 4 = number represents ten-thousandths of a unit.
  682. 5 = number represents hundred-thousandths of a unit.
  683. Default is 2.
  684.  
  685.  
  686. ColorResponseCurves
  687. Tag  = 301 (12D)
  688. Type = SHORT
  689. N    = 2**BitsPerSample (for Red samples) +
  690.                 2**BitsPerSample (for Green samples) +
  691.                 2**BitsPerSample (for Blue samples)
  692.  
  693. This tag defines three color response curves (one each for Red, Green and Blue
  694. color information).  The curves are stored sequentially (in red-green-blue
  695. order).  The size of each table is 2**BitsPerSample, using the BitsPerSample
  696. value corresponding to the respective color.  The ColorResponseUnit further
  697. specifies how each entry in the table is to be interpreted.
  698.  
  699. The purpose of the color response curves is to act as a lookup table mapping
  700. values from 0 to 2**BitsPerSample-1 into specific intensity values.  The
  701. intensity values are as specified by the NTSC color strandard assuming
  702. illumination to be CIE D6500.
  703.  
  704.  
  705. Correspondence to the Physical World
  706.  
  707. XResolution
  708. Tag  = 282  (11A)
  709. Type = RATIONAL
  710. N    = 1
  711.  
  712. The number of pixels per ResolutionUnit  (see below)  in the X direction, i.e.,
  713. in the ImageWidth direction.  It is, of course, not mandatory that the image be
  714. actually printed at the size implied by this parameter.  It is up to the
  715. application to use this information as it wishes.
  716.  
  717. As is the case for many of these fields, XResolution may be invalid and
  718. irrelevant for some images (e.g., images made with a hand-held digitizing
  719. camera, which has a three-dimensional nature) and should therefore be absent
  720. >from the image file.
  721. No default.
  722.  
  723.  
  724.  
  725. YResolution
  726. Tag  = 283  (11B)
  727. Type = RATIONAL
  728. N    = 1
  729.  
  730. The number of pixels per ResolutionUnit  in the Y direction, i.e., in the
  731. ImageLength direction.
  732. No default.
  733.  
  734.  
  735. ResolutionUnit
  736. Tag  = 296 (128)
  737. Type = SHORT
  738. N    = 1
  739.  
  740. To be used with XResolution and YResolution.
  741. 1 = no absolute unit of measurement.  Used for images that may have a
  742. non-square aspect ratio, but no meaningful absolute dimensions.
  743. 2 = inch
  744. 3 = centimeter
  745. Default is 2
  746.  
  747.  
  748. Orientation
  749. Tag  = 274 (112)
  750. Type = SHORT
  751. N    = 1
  752.  
  753. 1 =  The 0th row represents the visual top of the image, and the 0th column
  754. represents the visual left hand side.
  755. 2 =  The 0th row represents the visual top of the image, and the 0th column
  756. represents the visual right hand side.
  757. 3 =  The 0th row represents the visual bottom of the image, and the 0th column
  758. represents the visual right hand side.
  759. 4 =  The 0th row represents the visual bottom of the image, and the 0th column
  760. represents the visual left hand side.
  761. 5 =  The 0th row represents the visual left hand side of the image, and the 0th
  762. column represents the visual top.
  763. 6 =  The 0th row represents the visual right hand side of the image, and the
  764. 0th column represents the visual top.
  765. 7 =  The 0th row represents the visual right hand side of the image, and the
  766. 0th column represents the visual bottom.
  767. 8 =  The 0th row represents the visual left hand side of the image, and the 0th
  768. column represents the visual bottom.
  769. Default is 1.
  770.  
  771.  
  772. Document Context
  773.  
  774. DocumentName
  775. Tag  = 269  (10D)
  776. Type = ASCII
  777.  
  778. The name of the document from which this image was scanned.
  779. No default.
  780.  
  781.  
  782. PageName
  783. Tag  = 285  (11D)
  784. Type = ASCII
  785.  
  786. The name of the page from which this image was scanned.
  787. No default.
  788.  
  789.  
  790. XPosition
  791. Tag  = 286  (11E)
  792. Type = RATIONAL
  793.  
  794. The X offset of the left side of the image, with respect to the left side of
  795. the page, in inches.
  796. No default.
  797.  
  798.  
  799. YPosition
  800. Tag  = 287  (11F)
  801. Type = RATIONAL
  802.  
  803. The Y offset of the top of the image, with respect to the top of the page, in
  804. inches.  In the TIFF coordinate scheme, the positive Y direction is down, so
  805. that YPosition is always positive.
  806. No default.
  807.  
  808.  
  809. PageNumber
  810. Tag  = 297  (129)
  811. Type = SHORT
  812. N    = 2
  813.  
  814. This tag is used to specify page numbers of a multiple page (e.g. facsimile)
  815. document.  Two SHORT values are specified.  The first value is the page number;
  816. the second value is the total number of pages in the document.
  817.  
  818. Note that pages need not appear in numerical order.
  819.  
  820.  
  821.  
  822. Miscellaneous Strings
  823.  
  824. ImageDescription
  825. Tag  = 270 (10E)
  826. Type = ASCII
  827.  
  828. Useful or interesting information about the image.
  829. No default.
  830.  
  831.  
  832. Make
  833. Tag  = 271  (10F)
  834. Type = ASCII
  835.  
  836. The name of the scanner manufacturer.
  837. No default.
  838.  
  839.  
  840. Model
  841. Tag  = 272  (110)
  842. Type = ASCII
  843.  
  844. The model name/number of the scanner.
  845. No default.
  846.  
  847.  
  848. Storage Management
  849.  
  850. These fields may be useful in certain dynamic editing situations.  Software
  851. that merely reads TIFF files will probably not need to care about these fields.
  852. And, of course, software that creates TIFF files is by no means required to
  853. write these fields.
  854.  
  855. FreeOffsets
  856. Tag  = 288  (120)
  857. Type = LONG
  858.  
  859. For each free block in the file, its byte offset.
  860. No default.
  861.  
  862.  
  863. FreeByteCounts
  864. Tag  = 289  (121)
  865. Type = LONG
  866.  
  867. For each free block in the file, the number of bytes in the block.
  868.  
  869.  
  870.  
  871. 6) Examples
  872.  
  873. A binary image from a paint program might contain only SubfileType, ImageWidth,
  874. ImageLength, StripOffsets, and PhotometricInterpretation fields.
  875.  
  876. A typical line art scan might require that XResolution and YResolution be added
  877. to the above list.
  878.  
  879.  
  880.  
  881. 7) Private Fields
  882.  
  883. An organization may wish to store with the image file information that is
  884. meaningful only to that organization.  Tags numbered 32768 or higher are
  885. reserved for that purpose.  Upon request, the administrator will allocate and
  886. register a block of private tags for an organization, to avoid possible
  887. conflicts with other organizations.
  888.  
  889. Private enumerated values can be accommodated in a similar fashion.
  890. Enumeration constants numbered 32768 or higher are reserved for private usage.
  891. Upon request, the administrator will allocate and register a block of
  892. enumerated values for a particular field, to avoid possible conflicts.
  893.  
  894. Tags and values which are allocated in the private number range are not
  895. prohibited from being included in a future revision of this specification.
  896. Several such instances can be found in this revision.
  897.  
  898.  
  899. 8) A List of Possible Future Enhancements
  900.  
  901. In the future TIFF will very likely be expanded to support more compression
  902. schemes, more photometric schemes, color lookup tables, and non-rectangular
  903. images.  Please refer all questions regarding enhancements to TIFF to the
  904. contacts listed at the beginning of the document.   Written submissions should
  905. be in Microsoft Windows Write format, to ensure timely and error-free
  906. incorporation into the specification.
  907.  
  908.  
  909.